package com.hqd.ch03.v42.web.servlet.i18n;

import com.hqd.ch03.v42.context.i18n.LocaleContext;

import java.util.Locale;

public class SimpleLocaleContext implements LocaleContext {
    private final Locale locale;

    public SimpleLocaleContext(Locale locale) {
        this.locale = locale;
    }

    @Override
    public Locale getLocale() {
        return this.locale;
    }

    @Override
    public String toString() {
        return (this.locale != null ? this.locale.toString() : "-");
    }

}
